<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="huoyun" uri="/huoyun"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>搜索车源</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">

		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/theme/css/main.css">
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/theme/css/style_userCenter.css">
		<link rel="stylesheet" type="text/css"
			href="${pageContext.request.contextPath}/theme/css/dialog.css">
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/theme/js/jquery-1.6.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/theme/js/calendar/WdatePicker.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath}/theme/js/dialog.js"></script>
		<script type="text/javascript">
	function openDialog(goodsId, carId) {
		var urlStr = "${pageContext.request.contextPath}/car/preInviteCar.action?goodsId="
				+ goodsId + "&carId=" + carId;
		simpleBox.open( {
			title : "邀请车主竞标",
			type : 'url',
			value : urlStr
		});
	}
</script>
	</head>
	<body>
		<div>
			<jsp:include page="../../userAdmin/nav.jsp">
				<jsp:param value="nav_main" name="nav" />
			</jsp:include>
		</div>
		<div class="realCer">
			<!--主体部分-->
			<div class="realMain clearfix mt10">
				<!--左侧菜单-->
				<div class="realLeft" id="meunLeft">
					<jsp:include page="../../userAdmin/leftMenu.jsp">
						<jsp:param value="con_nav_main" name="con_nav" />
					</jsp:include>
				</div>
				<!--中间-->
				<div class="realRight ml10">
					<!--中间-->
					<div class="realR_left">
						<div class="box" style="width: 805px;">
							<div class="tit">
								<strong>搜索结果</strong>
							</div>
							<div class="con">
								<table class="listTable">
									<tr>
										<th>
											公司信息
										</th>
										<th>
											车牌号
										</th>
										<th>
											起始地/目的地
										</th>
										<th>
											发车时间区间
										</th>
										<th>
											可载
										</th>
										<th>
											是否返程
										</th>
										<th>
											操作
										</th>
									</tr>
									<s:if test="selectedCarPage && selectedCarPage.totalRecord > 0">
										<s:iterator value="selectedCarPage.objectList" id="pubInfo"
											status="st">
											<tr>
												<td>
													<img style="width:40px;height:40px" src="${pageContext.request.contextPath}<s:property value='#pubInfo.company.logoImg'/>" />
													<br/>
													<s:property value="#pubInfo.company.name" />
												</td>
												<td>
													<s:property value="#pubInfo.carNumber" />
												</td>
												<td>
													<s:iterator var="carRoute" value="carRouteList" status="st">
														<huoyun:regionSelect type="view"
															provinceValue="${carRoute.startProvince }"
															cityValue="${carRoute.startCity}"
															townValue="${carRoute.startTown}" />-
	        												<huoyun:regionSelect type="view"
															provinceValue="${carRoute.endProvince}"
															cityValue="${carRoute.endCity}"
															townValue="${carRoute.endTown}" />
														<br />
													</s:iterator>
												</td>
												<td>
													始:
													<s:property value="#pubInfo.starttime" />
													<br>
													终:
													<s:property value="#pubInfo.endtime" />
												</td>
												<td>
													<s:property value="#pubInfo.loadAmount" />
													<huoyun:customSelect value="${pubInfo.unit }"
														mode="measureType" type="view" />
												</td>
												<td>
													<s:if test="#pubInfo.retour==0">是</s:if>
													<s:elseif test="#pubInfo.retour==1">否</s:elseif>
												</td>
												<td id="operate_<s:property value="#pubInfo.carId"/>">
													<s:if
														test="#pubInfo.bidInfoId != null && #pubInfo.bidInfoId != ''">
														<s:if test="#pubInfo.bidInfoStatus == 0">
					        									车主已经应标，等待确认
					        								</s:if>
														<s:if test="#pubInfo.bidInfoStatus == 1">
					        									已被选择
					        								</s:if>
													</s:if>
													<s:elseif
														test="(#pubInfo.inviteId != null && #pubInfo.inviteId != '')">
														<s:if test="#pubInfo.inviteStatus == 0">
					        									等待车主相应
					        								</s:if>
														<s:elseif test="#pubInfo.inviteStatus == 1">
					        									车主已经回复
					        								</s:elseif>
														<s:else>
					        									车主拒绝应标
					        								</s:else>
													</s:elseif>
													<s:else>
														<input type="button" value="邀请"
															onclick="openDialog('<s:property value="goodsId"/>','<s:property value="#pubInfo.carId"/>')" />
													</s:else>
												</td>
											</tr>
										</s:iterator>
										<s:if test="cargoPage.totalPage > 1">
											<tr>
												<s:url var="queryCarsUrl" action="queryCars.action"
													namespace="/car"></s:url>
												<td colspan="7">
													<huoyun:page pageNo="${selectedCarPage.pageNo}"
														url="${queryCarsUrl}"
														totalPage="${selectedCarPage.totalPage}"
														totalRecord="${selectedCarPage.totalRecord}"></huoyun:page>
												</td>
											</tr>
										</s:if>
									</s:if>
									<s:else>
										<tr>
											<td colspan="7">
												没有匹配的车辆信息
											</td>
										</tr>
									</s:else>
								</table>
							</div>
						</div>
					</div>
					<!-- 中间 -->

				</div>
				<!--中由-->
			</div>
		</div>
		<div>
			<jsp:include page="/footer.jsp"></jsp:include>
		</div>
	</body>
</html>
